package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TContractMapper;
import com.ruoyi.system.domain.TContract;
import com.ruoyi.system.service.ITContractService;
import com.ruoyi.common.core.text.Convert;

/**
 * Service业务层处理
 *
 * @date 2021-03-26
 */
@Service
public class TContractServiceImpl implements ITContractService
{
    @Autowired
    private TContractMapper tContractMapper;

    /**
     * 查看合同
     * @param tContract
     * @return
     */
    @Override
    public TContract selectContractById(TContract tContract) {
        return tContractMapper.selectContractById(tContract.getContractId());
    }

    @Override
    public TContract selectTContractBySalesId(Long salesId) {
        return tContractMapper.selectTContractBySalesId(salesId);
    }

    /**
     * 查询
     */
    @Override
    public TContract selectTContractById(Long contractId)
    {
        return tContractMapper.selectTContractById(contractId);
    }

    /**
     * 查询
     */
    @Override
    public List<TContract> selectTContractList(TContract tContract)
    {
        return tContractMapper.selectTContractList(tContract);
    }

    /**
     * 新增
     */
    @Override
    public int insertTContract(TContract tContract)
    {
        return tContractMapper.insertTContract(tContract);
    }

    /**
     * 修改
     */
    @Override
    public int updateTContract(TContract tContract)
    {
        return tContractMapper.updateTContract(tContract);
    }

    /**
     * 删除
     */
    @Override
    public int deleteTContractByIds(String ids)
    {
        return tContractMapper.deleteTContractByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除
     */
    @Override
    public int deleteTContractById(Long contractId)
    {
        return tContractMapper.deleteTContractById(contractId);
    }
}